/**
 * Created by Jie on 2017/2/28.
 */
var process = require('child_process');
//直接调用命令
exports.run = function (_exec){
    console.log('exec: ' + _exec);
    process.exec(_exec,
    function (error, stdout, stderr) {
        console.log('exec error: ' + stderr);
        if (error !== null) {
            console.log('exec error: ' + error);
        }
    });
}
//调用执行文件
exports.openApp = function(){
    process.execFile('D:/testweb/aaa.bat',null,{cwd:'D:/'},
        function (error,stdout,stderr) {
            if (error !== null) {
                console.log('exec error: ' + error);
            }
        });
}